﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;


namespace Krile.Kernel.Control.Surface
{
    /// <summary>
    /// Command button basic implementation
    /// </summary>
    public class CommandButtonBasicImpl : CommandButton
    {
        public CommandButtonBasicImpl(Image ico, string desc)
        {
            this.description = desc;
            this.IconImage = ico;
            this.Enabled = true;
        }

        string description;
        public override string Description
        {
            get { return description; }
        }

        public event Action<ChainMouseEventArgs> OnMouseClicked;

        public override void OnMouseClick(object sender, ChainMouseEventArgs e)
        {
            if (OnMouseClicked == null)
                e.SetThrowSub();
            else
                OnMouseClicked.Invoke(e);
        }

        public override void OnMouseDoubleClick(object sender, ChainMouseEventArgs e)
        {
            this.OnMouseClick(sender, e);
        }
    }
}
